//
// Created by wze-zero on 2024/7/28 028.
//
#include <iostream>
#include <string>

using namespace std;

string toHexString(int n);

int main() {
    int n;
    cin >> n;
    string hexStr = toHexString(n);
    cout << hexStr << endl;
    return 0;
}

string toHexString(int n) {
    string s;
    int num;
    while (n % 16 != 0) {
        if (n >= 16) {
            num = n / 16;
        } else if (n > 0) {
            num = n % 16;
        } else {
            break;
        }
        if (num > 16) {
            s += toHexString(num);
        } else if (num < 10) {
            s += to_string(num);
        } else {
            s += 'A' + (num - 10);
        }
        n -= num * 16;
    }
    return s;
}